<template>
  <div class="user_right fl ml20">
    <div class="result_top">
      <div>
        <el-input v-model="model" placeholder="请输入要查询的型号"></el-input>
      </div>
      <div>
        <span>发布时间：</span>
        <el-date-picker v-model="start" type="date" placeholder="起始时间"></el-date-picker>
        <div class="ctrl"></div>
        <el-date-picker v-model="end" type="date" placeholder="结束时间"></el-date-picker>
      </div>
      <div class="btn_inquiry">
        <button>查询</button>
        <button>清空</button>
      </div>
    </div>
    <div class="result_content">
      <table>
        <colgroup>
          <col width="30" />
          <col width="70" />
          <col width="100" />
          <col width="150" />
          <col width="160" />
          <col width="160" />
          <col width="130" />
          <col width="108" />
        </colgroup>
        <tbody>
          <tr class="tr_top">
            <th></th>
            <th>编号</th>
            <th>品牌</th>
            <th>型号</th>
            <th>采购数量（套）</th>
            <th>报价（元/套）</th>
            <th>收货地</th>
            <th>状态</th>
          </tr>
        </tbody>
        <tbody v-for="(item,index) in 10" :key="index">
          <tr>
            <th colspan="8">
              <div class="slotd"></div>
            </th>
          </tr>
          <tr class="tr_content">
            <td>
              <div class="btn_isShow" @click="btnIsShow">{{isshowText}}</div>
            </td>
            <td>001</td>
            <td @click="animation_in(index)">施耐德</td>
            <td>C60 UL489</td>
            <td>256套</td>
            <td>288/套</td>
            <td>湖北武汉</td>
            <td>未成交</td>
          </tr>
          <tr v-show="isshow" ref="wtrs" class="wtrs">
            <td colspan="8" class="w_tr">
              <table class="content_body">
                <colgroup>
                  <col width="95" />
                  <col width="110" />
                  <col width="153" />
                  <col width="98" />
                  <col width="90" />
                  <col width="153" />
                  <col width="165" />
                </colgroup>
                <tbody>
                  <tr class="tb_tr_a">
                    <th>买家</th>
                    <th>品牌</th>
                    <th>型号</th>
                    <th>供应链</th>
                    <th>成交数量</th>
                    <th>单价（元/套）</th>
                    <th>订单号</th>
                  </tr>
                </tbody>
                <tbody>
                  <tr class="tb_tr_b">
                    <td>匿名</td>
                    <td>施耐德</td>
                    <td>C60 UL489</td>
                    <td>12套</td>
                    <td>2套</td>
                    <td>485.00套</td>
                    <td>DT689823106</td>
                  </tr>
                </tbody>
              </table>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <div class="laypage">
      <el-pagination background layout="prev, pager, next" :total="1000"></el-pagination>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      model: "",
      start: "",
      end: "",
      isshow: false,
      isshowText: "+"
    };
  },
  methods: {
    btnIsShow() {
      this.isshow = !this.isshow;
      if (this.isshow) {
        this.isshowText = "－";
      } else {
        this.isshowText = "+";
      }
    },
    animation_in(index) {
      // let trHeight =
      setTimeout(() => {
        let wtrs = this.$refs.wtrs;
        console.log(wtrs[index].scrollHeight);
        let wtrHeight = wtrs[index].scrollHeight;
      }, 100);

      // console.log(trHeight)
    }
  }
};
</script>

<style lang="scss" scope>
.user_right {
  padding-bottom: 50px;
}
.result_top {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  > div {
    display: flex;
    align-items: center;
    &:nth-child(1) {
      margin-right: 43px;
      .el-input {
        width: 220px;
        .el-input__inner {
          height: 32px;
          line-height: 32px;
        }
      }
    }
    &:nth-child(2) {
      margin-right: 24px;
      > span {
        font-size: 18px;
        color: #333;
      }
      .el-input {
        width: 140px;
        .el-input__inner {
          height: 32px;
          line-height: 32px;
        }
      }
    }
    &:nth-child(3) {
      > button {
        width: 100px;
        border-radius: 3px;
        height: 32px;
        border: 0;
        color: #fff;
        transition: all 0.2s ease-in-out;
        &:nth-child(1) {
          background: #4448f8;
          margin-right: 13px;
          &:hover {
            background: #777acc9d;
          }
        }
        &:nth-child(2) {
          background: #bfbfbf;
          &:hover {
            background: #5f5959;
          }
        }
      }
    }
  }
}
.ctrl {
  width: 15px;
  height: 3px;
  background: #eeeeee;
  border-radius: 5px;
  margin: 0 3px;
}
.result_content {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 35px;
}
.tr_top {
  background: #e5e5e5;
  height: 50px;
  width: 912px;
  border: 2px solid #e5e5e5;
}
.tr_content {
  height: 40px !important;
  width: 910px;
  background: #dadaf4;
  text-align: center;
}
.content_body {
  margin: 0 auto;
  text-align: center;
  border: 1px solid #f1f1f1;
  border-radius: 1px;
  overflow: hidden;
  border-top-left-radius: 1em;
  border-top-right-radius: 1em;
  border-bottom-right-radius: 1em;
  border-bottom-left-radius: 1em;
}
.tb_tr_a {
  height: 48px;
  background: #ebebeb;
  border-bottom: 2px dashed #ffffff;
}
.tb_tr_b {
  height: 57px;
  background: #ebebeb;
}
.w_tr {
  padding: 14px;
  border: {
    left: 2px solid #dadafe;
    right: 2px solid #dadafe;
    bottom: 2px solid #dadafe;
  }
}
.tr_content {
  border: 2px solid #dadafe;
}
.slotd {
  width: 100%;
  height: 15px;
}
.btn_isShow {
  width: 20px;
  height: 20px;
  background: #4448f8;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 5px;
  margin-left: 10px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.laypage {
  margin-top: 60px;
  display: flex;
  justify-content: center;
}
.btn_isShow:hover {
  animation: rotat 1s linear forwards;
}
@keyframes rotat {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(90deg);
  }
  50% {
    transform: rotate(180deg);
  }
  75% {
    transform: rotate(270deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
</style>